import request from '@/utils/request'

// 聊天 API
export function chat(data) {
  return request({
    url: '/chatbot/api/chat/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

// 对话 API
export function conversation(data) {
  return request({
    url: '/chatbot/api/conversation/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

// 消息列表 API
export function getMessageList(args) {
  return request({
    url: `/chatbot/api/message/list/${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

// 发送消息 API
export function sendMessage(data) {
  return request({
    url: '/chatbot/api/message/send/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}
